﻿if(window.addEventListener){
//window.addEventListener("load", checkVersion, true); // FF
}else{
window.attachEvent("onload",checkVersion); // IE
}

function getInternetExplorerVersion() {
  var rv = -1;
  if (navigator.appName == 'Microsoft Internet Explorer') {
   var ua = navigator.userAgent;
   var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
   if (re.exec(ua) != null)
   rv = parseFloat(RegExp.$1);
  }
  return rv;
 } 

 function checkVersion() {
  var ver = getInternetExplorerVersion();
  var msg = "";
  /*
  if (ver > -1)
   msg = "You are using Internet Explorer " + ver;
  else
   msg = "You are not using Internet Explorer";
   */
   if( ver == 6 || ver == 7 ){
	if ( iecheck_getCookie( "iecheck" ) != "done" )
		{
			window.open('/center/popup/20120209/pop_20120209.html', '', 'width=660, height=495,scrollbars=yes,top=50,left=50');
		}
   }else{
	//window.open('/center/popup/20120209/pop_20120209.html', '', 'width=660, height=488,scrollbars=yes,top=50,left=50');
   }
 }
 
 
 function iecheck_getCookie( name )
{
        var nameOfCookie = name + "=";
        var x = 0;
        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
                x = document.cookie.indexOf( " ", x ) + 1;
                if ( x == 0 )
                        break;
        }
        return "";
}